class Scence3 extends Scence {
	public constructor() {
		super();
	}
	protected OnAdd() {
		this.init();
	}

	private init() {
		let jx1:egret.TextField=new egret.TextField();
        jx1.text="第三个界面";
        jx1.border=true;
        jx1.borderColor=0xff0000;
        jx1.width=400;
        jx1.height=50;
        jx1.size=50;
        jx1.x=150;
        jx1.y=200;
        this.addChild(jx1);

		let jx3:egret.TextField=new egret.TextField();
        jx3.text="跳到第一个界面";
        jx3.border=true;
        jx3.borderColor=0xff0000;
        jx3.width=400;
        jx3.height=50;
        jx3.size=50;
        jx3.x=120;
        jx3.y=400;
        this.addChild(jx3);
        jx3.touchEnabled=true;
        jx3.addEventListener(egret.TouchEvent.TOUCH_TAP,this.myfunction1,this)
       

        let jx2:egret.TextField=new egret.TextField();
        jx2.text="跳到第二个界面";
        jx2.border=true;
        jx2.borderColor=0xff0000;
        jx2.width=400;
        jx2.height=50;
        jx2.size=50;
        jx2.x=120;
        jx2.y=600;
        this.addChild(jx2);
        jx2.touchEnabled=true;
        jx2.addEventListener(egret.TouchEvent.TOUCH_TAP,this.myfunction2,this)

		let t: egret.URLLoader = new egret.URLLoader();
		t.dataFormat = egret.URLLoaderDataFormat.SOUND;
		let req: egret.URLRequest = new egret.URLRequest('resource/music2.mp3');
		t.load(req);
		t.addEventListener(egret.Event.COMPLETE, function (event: egret.Event) {
			// let tt=<egret.URLLoader>event.target;
			let gg = <egret.Sound>t.data;
			//  let hh:egret.Sound=new egret.Sound();
			gg.play(0, 1);
		}, this)
	}
	private myfunction1(){
	   let t: egret.URLLoader = new egret.URLLoader();
		t.dataFormat = egret.URLLoaderDataFormat.SOUND;
		let req: egret.URLRequest = new egret.URLRequest('resource/music2.mp3');
		t.load(req);
		t.addEventListener(egret.Event.COMPLETE, function (event: egret.Event) {
			// let tt=<egret.URLLoader>event.target;
			let gg = <egret.Sound>t.data;
			//  let hh:egret.Sound=new egret.Sound();
			gg.play(0, 0);
		}, this)

        let s1:Scence1 = new Scence1();
        Guanli_Scence.get().changeScene(s1);

	
	}
        
	private myfunction2(){
        let s2:Scence2 = new Scence2();
         Guanli_Scence.get().changeScene(s2);

		 let t: egret.URLLoader = new egret.URLLoader();
		t.dataFormat = egret.URLLoaderDataFormat.SOUND;
		let req: egret.URLRequest = new egret.URLRequest('resource/music2.mp3');
		t.load(req);
		t.addEventListener(egret.Event.COMPLETE, function (event: egret.Event) {
			// let tt=<egret.URLLoader>event.target;
			let gg = <egret.Sound>t.data;
			//  let hh:egret.Sound=new egret.Sound();
			gg.play(0, 0);
		}, this)
        }
	

	protected OnRem() {

	}
}